The on-screen waveform display is typically what you see in an audio-editing application; time is displayed on a horizontal (X) axis while amplitude is displayed on a vertical (Y) axis. A program that displays an audio waveform on a computer screen has some target Y coordinate where it wants to place zero amplitude data.
Let's call this Y-coordinate screen_intercept . The program also has some differential number of pixels above and below screen_intercept where it wants to place full amplitude data. Let's call this screen_slope .
The program reads audio samples out of memory. As with the A/D - D/A example, there must be a numerical sample value corresponding to "zero amplitude," and a numerical sample difference which when added to or subtracted from the zero amplitude level, produces full amplitude. Let's call these memory_intercept and memory_slope , respectively.
The program then performs exactly the same operation to map numerical sample values n to Y-coordinates y:
y = screen_intercept +
screen_slope * (n - memory_intercept) / memory_slope;
Again, the four parameters define a mapping that allows us to choose Y-coordinates.
| Previous | Chapter Contents | Chapter Top | Next |